<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<p:panel style="border: none;">
	<h:panelGrid columns="3" cellpadding="2" style="border: 2px;">
		<h:outputText value="Código" />
		<h:outputText value="Cargo" />
		<h:outputText value="" />

		<p:inputText value="#{beanCargo.filtro.id}" maxlength="4" size="7" />


		<p:inputText value="#{beanCargo.filtro.descricao}" size="78" />

		<p:commandButton value="Buscar" icon="ui-icon-search"
			action="#{beanCargo.find}" update="pTabelaCargo" />
	</h:panelGrid>

	<br></br>
	<p:separator />

	<p:dataTable value="#{beanCargo.cargos}" var="cargo" id="pTabelaCargo">
		<p:column headerText="Codigo" width="10px">
			<h:outputText value="#{cargo.id}" />
		</p:column>

		<p:column headerText="Cargo">
			<h:outputText value="#{cargo.descricao}" />
		</p:column>

		<p:column headerText="Selecionar" width="10">
			<p:commandButton id="selectCidade" ajax="false"
				oncomplete="dConsultaCargo.hide()" icon="ui-icon-circle-check"
				title="selecionar">
				<f:setPropertyActionListener value="#{cargo}"
					target="#{beanFuncionario.funcionario.cargo}" />
			</p:commandButton>
		</p:column>
	</p:dataTable>

	<p:separator />
	<br></br>

	<h:panelGrid columns="2">
		<p:commandButton value="Novo" title="Criar Cargo"
			onclick="dManterCargo.show() ">

		</p:commandButton>
		<p:commandButton value="Voltar" onclick="dConsultaCargo.hide() " />
	</h:panelGrid>

</p:panel>

<p:dialog header="Manter Cargo" widgetVar="dManterCargo"
	id="manterCargo" resizable="false">
	<ui:include src="/cargo/pManterCargo.xhtml"></ui:include>
</p:dialog>

</html>